#
#   Demonstrates static mesh emitter, simply render a "static" particle
#   on mesh vertex positions.
#
#   (C) 2001 RadonLabs GmbH
#
sel ('/usr/scene')
execfile ('licht.py')
pos=new ('n3dnode','pos')
sel ('pos')
pos.sxyz(0.3,0.3,0.3)
rotz=new ('nipol','rotz')
sel ('rotz')
rotz.connect('rz')
rotz.addkey1f(0,0)
rotz.addkey1f(5,360)
sel ('..')
rotx=new ('nipol','rotx')
sel ('rotx')
rotx.connect('rx')
rotx.addkey1f(0,0)
rotx.addkey1f(4,360)
sel ('..')
sr=new ('nspriterender','sr')
sel ('sr')
me=new ('nstaticmeshemitter','me')
sel ('me')
mesh=new ('nmeshipol','mesh')
sel ('mesh')
mesh1=new ('nmeshnode','mesh1')
mesh1.setfilename("../meshes/torus1.n3d")
mesh1.setreadonly(1)
mesh2=new ('nmeshnode','mesh2')
mesh2.setfilename("../meshes/torus2.n3d")
mesh2.setreadonly(1)
mesh3=new ('nmeshnode','mesh3')
mesh3.setfilename("../meshes/torus3.n3d")
mesh3.setreadonly(1)
mesh4=new ('nmeshnode','mesh4')
mesh4.setfilename("../meshes/torus4.n3d")
mesh4.setreadonly(1)
mesh5=new ('nmeshnode','mesh5')
mesh5.setfilename("../meshes/torus5.n3d")
mesh5.setreadonly(1)
mesh.setreadonly(1)
mesh.beginkeys(7)
mesh.setkey(0,0,'mesh1')
mesh.setkey(1,1,'mesh2')
mesh.setkey(2,2,'mesh3')
mesh.setkey(3,3,'mesh5')
mesh.setkey(4,4,'mesh4')
mesh.setkey(5,5,'mesh5')
mesh.setkey(6,6,'mesh1')
mesh.endkeys()
mesh.setupdatecoord(1)
mesh.setupdatenorm(1)
mesh.setupdatecolor(0)
mesh.setupdateuv0(1)
mesh.setupdateuv1(0)
mesh.setupdateuv2(0)
mesh.setupdateuv3(0)
sel ('..')
me.setlifetime(10)
me.setmeshnode('mesh')
sel ('..')
#sr.setminlod(0.000000)
sr.setreptype("loop")
sr.setchannel("time")
sr.setscale(1.000000)
sr.setstretch(0)
sr.setspin(0.000000)
sr.setspinaccel(0.000000)
sr.setemitter("me")
sr.beginkeys(7)
sr.setkey(0,0.100000,0.000000,0.300000,0.000000,0.000000,1.000000)
sr.setkey(1,0.200000,0.000000,0.300000,0.300000,0.000000,1.000000)
sr.setkey(2,0.300000,0.000000,0.000000,0.300000,0.000000,1.000000)
sr.setkey(3,0.400000,0.000000,0.000000,0.300000,0.300000,1.000000)
sr.setkey(4,0.500000,0.000000,0.000000,0.000000,0.300000,1.000000)
sr.setkey(5,0.400000,0.000000,0.000000,0.000000,0.000000,1.000000)
sr.setkey(6,0.100000,0.000000,0.300000,0.000000,0.000000,1.000000)
sr.endkeys()
sel ('..')
shd=new ('nshadernode','shd')
sel ('shd')
#shd.setminlod(0.000000)
shd.setrenderpri(0)
shd.setnumstages(1)
shd.setcolorop(0,"mul tex prev" )
shd.setalphaop(0,"nop")
shd.setconst(0,0.000000,0.000000,0.000000,0.000000)
shd.begintunit(0)
shd.setaddress("wrap","wrap")
shd.setminmagfilter("linear_mipmap_nearest","linear")
shd.settexcoordsrc("uv0")
shd.setenabletransform(0)
shd.txyz(0.000000,0.000000,0.000000)
shd.rxyz(0.000000,0.000000,0.000000)
shd.sxyz(1.000000,1.000000,1.000000)
shd.endtunit()
shd.setdiffuse(0.000000,0.000000,0.000000,0.000000)
shd.setemissive(0.000000,0.000000,0.000000,0.000000)
shd.setambient(0.000000,0.000000,0.000000,0.000000)
shd.setlightenable(0)
shd.setalphaenable(1)
shd.setzwriteenable(0)
shd.setfogenable(0)
shd.setalphablend("one","one")
shd.setzfunc("lessequal")
shd.setcullmode("ccw")
shd.setcolormaterial("material")
sel ('..')
tex=new ('ntexarraynode','tex')
sel ('tex')
#tex.setminlod(0.000000)
tex.settexture(0,"../bmp/glow.bmp","none")
tex.setgenmipmaps(0,1)
tex.setgenmipmaps(1,1)
tex.setgenmipmaps(2,1)
tex.setgenmipmaps(3,1)
sel ('..')
sel ('..')
